<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="app" uri="/application" %>
<%@ taglib  prefix="s"  uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
 .searchtag {display: inline;}
 .searchtag dd {
    color: #5C5C5C;
    background:#FEF9DE;
    display: inline;
    float: left;
    white-space: nowrap;
    margin-left:10px;
    padding:1px;
}
.searchtag dd span {background: url("../images/sprite.png") no-repeat scroll -126px -30px transparent; 
    cursor: pointer;
    display: inline-block;
    height: 12px;
    overflow: hidden;
    position: relative;
    top: 2px;
    width: 13px;
    }
.searchtag {
    position: relative;
}
.searchtag dt {
    left: 15px;
    position: absolute;
    top: 10px;
}
#keyword_list_div {}
.list_div span {color: #5C5C5C; background:#FEF9DE;height:22px;display: inline-block;margin:2px;padding:2px;min-width: 80px;text-align: center;}
.content_main table td {text-align: left;}
</style>

</head>
<body>
<div id="all_main">
  <div class="head_main">
    <div class="main_nav">广告订单->选择投放条件</div>
    <div class="main_soso">
    	
    </div>
    <div class="main_title">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <th width="100%" style="border-left:none;text-align: left;font-weight: normal;"><span style="color:#229BC1;font-weight: bold;">广告基本信息</span> -&gt;投放条件-&gt;投放媒体选择-&gt;完成 </th>
        </tr>
      </table>
    </div>
  </div>
  <div class="content_main">
    <form action="/campaign/su_campaign_two.shtml" name="form01">
    <input name="id" value="${campaign.adId}"  type="hidden"/>
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr>
        <td width="15%" style="border-left:none" align="right">投放平台：</td>
        <td width="">
            android:<input type="radio" name="campaign.os"  value="android" <c:if test="${campaign.os!='ios'}">checked="checked"</c:if> />&nbsp;&nbsp; ios:<input type="radio" name="campaign.os" value="ios" <c:if test="${campaign.os=='ios'}">checked="checked"</c:if> />&nbsp;&nbsp;
        </span>
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">终端类型：</td>
        <td width="">
                                所有类型:<input type="radio" name="campaign.padSet"  value="2" <c:if test="${campaign.padSet!='0'}">checked="checked"</c:if> />&nbsp;&nbsp; pad:<input type="radio" name="campaign.padSet" value="1" <c:if test="${campaign.os=='0'}">checked="checked"</c:if> />&nbsp;&nbsp;非pad:<input type="radio" name="campaign.padSet" value="0" <c:if test="${campaign.os=='0'}">checked="checked"</c:if> />&nbsp;&nbsp;
        </span>
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">运营商：</td>
        <td width="">
                               所有:<input type="radio" name="campaign.operatorSet"  value="1" <c:if test="${campaign.operatorSet!='0'}">checked="checked"</c:if> />&nbsp;&nbsp; 具体运营商:<input type="radio" name="campaign.operatorSet" value="0" <c:if test="${campaign.operatorSet=='0'}">checked="checked"</c:if> />&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;
            <c:forEach items="${operList}" var="o" varStatus="oi">
                 ${o.contsName}  <input type="checkbox" name="opers" <c:if test="${oi.first}">checked="checked"</c:if>  value="${o.code}"/>&nbsp;&nbsp;
            </c:forEach>
        </td>
      </tr>
            <tr>
        <td width="15%" style="border-left:none" align="right">投放频次：</td>
        <td width="">
            <input type="number" name="campaign.showLimit" value="${campaign.showLimit}" size="8" /> 单个用户的显示次数控制。
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">投放时段：</td>
        <td width="">
                所有时段:<input type="radio" name="campaign.hourSet" value="1"  <c:if test="${campaign.hourSet!='0'}">checked="checked"</c:if> />&nbsp;&nbsp; 具体地区:<input type="radio" name="campaign.hourSet" value="0" <c:if test="${campaign.hourSet=='0'}">checked="checked"</c:if> />&nbsp;&nbsp;
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">&nbsp;</td>
        <td width="">
        <div class="list_div" style="">
	           <span>00: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>01: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>02: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>03: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>04: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>05: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>06: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>07: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>08: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>09: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>10: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>11: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>12: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>13: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>14: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>15: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>16: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>17: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>18: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>19: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>20: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>21: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>22: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           <span>23: <input type="checkbox" name="areas"  value=""/>&nbsp;&nbsp;</span>
	           
        </div>
        </td>
      </tr>
      
      
      
      <tr>
        <td width="15%" style="border-left:none" align="right">地区：</td>
        <td width="">
                                所有地区:<input type="radio" name="campaign.areaSet" value="1"  <c:if test="${campaign.areaSet!='0'}">checked="checked"</c:if> />&nbsp;&nbsp; 具体地区:<input type="radio" name="campaign.areaSet" value="0" <c:if test="${campaign.areaSet=='0'}">checked="checked"</c:if> />&nbsp;&nbsp;
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">&nbsp;</td>
        <td width="">
        <div id="keyword_list_div" class="list_div" style="">
	          <c:forEach items="${areaList}" var="o" varStatus="oi">
	                <span>${o.chnName}  <input type="checkbox" name="areas"  value="${o.id}"/>&nbsp;&nbsp;</span>
	            </c:forEach>
	    </div>
        </td>
      </tr>

    </table>
    </form>
  </div>
  <div class="lapel" style="background:#FFFFFF;"><span><input name="" type="button" class="input01" value="下一步" onclick="validate.submit();"/></span></div>
</div>
<div id="boxId" style="position: absolute;background: red;display:none;"><span style="color:#fff;">正在加载...</span></div>
</body>
</html>
<script type="text/javascript" src="/scripts/util.js"></script>
<script type="text/javascript" src="/scripts/xhr.js"/></script>
<script type="text/javascript" src="/scripts/form_validate.js"></script>
<script type="text/javascript">
validate.addvalidte(document.form01,{
        rules:{
           "campaign.operatorSet":{checkNull:true}
           },
	    message:{}
	    });

var adId="${campaign.adId}";

function ck(){
	if(adId.length>0){
		util.dusk_div("boxId");
         function callback(d){
            util.close_dusk("boxId");
            var o = eval("("+d+")");
            checkDo("opers",o.operReg||"");
            checkDo("areas",o.areaReg||"");
         }
         new xhr("/campaign/check_campaign_two.shtml",callback).setParameter("id",adId).execute();
	}
}
  function checkDo(name,reg){
     var r = document.getElementsByName(name);
     var regxp = new RegExp("^("+reg+")$");
     util.each(r,function(e){
        e.checked = regxp.test(e.value);
     })
  }
  ck();

</script>
